home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Clipboard / Clipboard.h < prev    next >
Text File  |  2000-06-23  |  847b  |  52 lines

  1. // Clipboard.h
  2.  
  3. #ifndef Clipboard_h
  4. #define Clipboard_h
  5.  
  6. #ifndef ListLink_h
  7. #include "ListLink.h"
  8. #endif
  9. #ifndef ListOf_h
  10. #include "ListOf.h"
  11. #endif
  12.  
  13. class ScrapReader;
  14. class ScrapWriter;
  15.  
  16. class Clipboard
  17.   {
  18.     private:
  19.         ListLink< Clipboard > validLink;
  20.         
  21.         static Clipboard *unexported;
  22.         static ListOf< Clipboard >& ValidList();
  23.         
  24.         // not implemented:
  25.             Clipboard( const Clipboard& );
  26.             void operator=( const Clipboard& );
  27.         
  28.     protected:
  29.         ~Clipboard();
  30.  
  31.         virtual void Import( const ScrapReader& ) = 0;
  32.         virtual void Export( ScrapWriter& ) const = 0;
  33.         virtual void Clear() = 0;
  34.         
  35.     public:
  36.         Clipboard();
  37.         
  38.         bool Valid() const        { return validLink.Owned(); }
  39.         void Validate();
  40.         void Invalidate();
  41.         
  42.         void MarkValid();
  43.         void Changed();
  44.         
  45.         void Flush() const;
  46.  
  47.         static void InvalidateAll();
  48.         static void FlushAll();
  49.   };
  50.  
  51. #endif
  52.